/* 获取地址经纬度地址 */

function geoCodeByAddress() {
	var geocoder = new AMap.Geocoder({
		city: "天津", //城市设为天津，默认：“全国”
	});
	geocoder.getLocation('海泰绿色产业基地M6', function(status, result) {
		if (status === 'complete' && result.geocodes.length) {
			var lnglat = result.geocodes[0].location;
		} else {

		}
	});
}
//添加临时点并打开气泡
function addPopup(info, map) {
	

	var circle = L.circleMarker([info.location.lat, info.location.lng], {
		radius: 2,
		color: 'red'
	}).addTo(map);

	flyTo(map, info.location.lat, info.location.lng);

	circle.bindPopup(info.name).openPopup();
	return circle;
}
//定位到指定的点
function flyTo(map, lat, lng, zoom) {
	map.flyTo([lat, lng], zoom || 17)
}
//清除临时绘制的图形
function clearTheMarker(marker, map) {
	map.removeLayer(marker)
}
//清除所有临时绘制
function clearAllMarker(markers, map) {
	markers.forEach(function(item, index, array) {
		clearTheMarker(item, map);
	});
}